// TextureDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CGWork.h"
#include "TextureDlg.h"
#include "afxdialogex.h"



// TextureDlg dialog

IMPLEMENT_DYNAMIC(TextureDlg, CDialogEx)

TextureDlg::TextureDlg(CWnd* pParent /*=NULL*/)
	: CDialogEx(TextureDlg::IDD, pParent)
	, objList2(_T(""))
{
	

}

TextureDlg::~TextureDlg()
{
}

 BOOL TextureDlg::OnInitDialog(){

	 //CDialog::OnInitDialog();
	CString str;
	
	std::string tmp;
	for (int i = 0 ; i < objNameArray.size(); i++){
	
		tmp = tmp + "   " + objNameArray[i];
		shadingTypes.push_back(1);
	}
	
	objectsEdit10.SetWindowTextA(TEXT(tmp.c_str()));
	return true;
				
}

void TextureDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	//DDX_Control(pDX, IDC_LIST2, objectList);
	DDX_Control(pDX, IDC_BUTTON1, addObjects);
	//	DDX_LBString(pDX, IDC_LIST2, objList2);
	//DDX_Control(pDX, IDC_LIST4, objList5);
	DDX_Control(pDX, IDC_EDIT2, objEditBox);
	DDX_Control(pDX, IDC_EDIT3, textureAns);
	DDX_Control(pDX, IDC_EDIT4, objectsEdit10);
}


BEGIN_MESSAGE_MAP(TextureDlg, CDialogEx)
	/*ON_BN_CLICKED(IDC_BUTTON1, &TextureDlg::OnBnClickedButton1)
	//ON_LBN_SELCHANGE(IDC_LIST4, &TextureDlg::OnLbnSelchangeList4)
	ON_BN_CLICKED(IDC_BUTTON2, &TextureDlg::OnBnClickedButton2)
	ON_BN_CLICKED(IDC_BUTTON3, &TextureDlg::OnBnClickedButton3)
	ON_BN_CLICKED(IDC_BUTTON4, &TextureDlg::OnBnClickedButton4)
	ON_BN_CLICKED(IDC_BUTTON5, &TextureDlg::OnBnClickedButton5)
	ON_BN_CLICKED(IDC_BUTTON6, &TextureDlg::OnBnClickedButton6)
	ON_BN_CLICKED(IDC_BUTTON7, &TextureDlg::OnBnClickedButton7)
	ON_BN_CLICKED(IDC_BUTTON8, &TextureDlg::OnBnClickedButton8)
	ON_BN_CLICKED(IDC_BUTTON9, &TextureDlg::OnBnClickedButton9)
	ON_BN_CLICKED(IDC_BUTTON10, &TextureDlg::OnBnClickedButton10)
	ON_BN_CLICKED(IDC_BUTTON11, &TextureDlg::OnBnClickedButton11)
	ON_BN_CLICKED(IDC_BUTTON12, &TextureDlg::OnBnClickedButton12)
	ON_BN_CLICKED(IDC_BUTTON13, &TextureDlg::OnBnClickedButton13)*/
END_MESSAGE_MAP()


// TextureDlg message handlers


void TextureDlg::OnBnClickedButton1()
{
	// TODO: Add your control notification handler code here
	
}


void TextureDlg::OnLbnSelchangeList4()
{
	// TODO: Add your control notification handler code here
}


void TextureDlg::OnBnClickedButton2()
{
	if (shadingTypes.size()> 1){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[0] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton3()
{
	// TODO: Add your control notification handler code here
	if (shadingTypes.size()> 2){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[1] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton4()
{
	if (shadingTypes.size()> 3){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[2] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton5()
{
	if (shadingTypes.size()> 4){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[3] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton6()
{
	if (shadingTypes.size()> 5){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[4] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton7()
{
	if (shadingTypes.size()> 6){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[5] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton8()
{
	if (shadingTypes.size()> 7){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[6] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton9()
{
	if (shadingTypes.size()> 8){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[7] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton10()
{
	if (shadingTypes.size()> 9){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[8] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton11()
{
	if (shadingTypes.size()> 10){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[9] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton12()
{
	if (shadingTypes.size()> 11){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[10] = dlg.type;
		}
	}
}


void TextureDlg::OnBnClickedButton13()
{
	if (shadingTypes.size()> 12){
		ObjectTextureDlg dlg;
		if (dlg.DoModal() == IDOK){

			 shadingTypes[11] = dlg.type;
		}
	}
}
